

*The following script replicates all analyses in "Trends in Public Support for Welfare Spending: How the Economy Matters," by Christopher Wlezen and Stuart Soroka, forthcoming in the British Journal of Political Science.

*Analyses rely on a dataset that merges together variables from the General Social Survey, the FRED, and OMB Historical Tables.  That dataset is available here as wlezien.soroka.bjpols2019.replication.dta.

xtset year

***********************************************************
*Figure 1
set more off
gen pr_fare2 = pr2_fare
table year, c(mean pr_fare2 mean sp2_welf)
*top panel:preferences
gen cat1=.
gen cat2=.
gen cat3=.
tab pr_fare2, gen(pr_fare2_cat)
tablemat pr_fare2_cat1 pr_fare2_cat2 pr_fare2_cat3, stat(mean) by(year)
matrix A=M'
svmat A, names(sum_welf)
tablemat year, stat(mean) by(year)
matrix A=M'
svmat A, names(sum_year)
replace sum_year=. if _n==1
replace cat1=sum_welf1
replace cat2=sum_welf1+sum_welf2
replace cat3=1 if cat2~=.
graph twoway area cat3 cat2 cat1 sum_year if sum_year>1972, color(gs13 gs16 gs12) ///
	lwidth(vthin vthin vthin) lcolor(gs7 gs7 gs7) scheme(s1mono)  ///
	xtitle("") ytitle("Preferences") xscale(range(1973 2016)) ///
	xlab(1980 1990 2000 2010) ylab(0 .2 .4 .6 .8 1, angle(0)) ///
	legend(off) ///
	text(.4 1978 "Less") text(.7 1978 "Same") text(.95 1978 "More") ///
	title("Do you think the government is spending too much, too little or about the right amount on welfare?" " ", ///
	size(small) color(black) position(7) ring(0) margin(3 3 3 3))
drop sum_*
drop cat1 cat2 cat3 pr_fare2_cat*
*bottom panel: preferences
tablemat pr_fare2 sp2_welf, stat(mean) by(year)
matrix A=M'
svmat A, names(sum_welf)
tablemat year, stat(mean) by(year)
matrix A=M'
svmat A, names(sum_year)
replace sum_year=. if _n==1
graph twoway line sum_welf1 sum_year if sum_year>1972, scheme(s1mono) lwidth(thick) lcolor(black) ///
	xtitle("") ytitle("Net Preferences") ylab(-60 -40 -20 0 , angle(0)) yscale(range(-60 10))  ///
	yline(0, lstyle(p2) lcolor(gray)) xlab(1980 1990 2000 2010) xscale(range(1973 2016))  ///
	title("Do you think the government is spending too much, too little or about the right amount on welfare?" "(% More - % Less) ", ///
	size(small) color(black) position(7) ring(0) margin(3 3 3 3))
drop sum_*


***********************************************************
*Table 1
set more off 
xtreg  pr_fare sp2_welf time female age educat2 educat3 working2 working3 faminc2-faminc4 black hisother reg_midatlantic-reg_pacific, re
estimates store prwelf1a
xtreg  pr_fare sp2_welf time unemp gdp female age educat2 educat3 working2 working3 faminc2-faminc4 black hisother reg_midatlantic-reg_pacific, re
estimates store prwelf1b
xtreg  pr_fare sp2_welf time unemp gdp gini100 female age educat2 educat3 working2 working3 faminc2-faminc4 black hisother reg_midatlantic-reg_pacific, re
estimates store prwelf1c
esttab prwelf1a prwelf1b prwelf1c, se
estout prwelf1a prwelf1b prwelf1c using "Table1.txt", nolz notype delimiter(" `=char(9)'") /*
    */ cells("b(star fmt(3)) se(par(( )) fmt(3))") starlevels(* .05 ** .01 *** .001) /*
    */ stats(N N_g, fmt(3)) replace
*interpreting results
su sp2_welf if e(sample)
su pr_fare if e(sample)
display 1.75*.055	
display 1040-400
display 6.40*.055
su gdp if e(sample)
*testing cpi for footnote #20
xtreg  pr_fare sp2_welf time unemp gdp gini100 cpi female age educat2 educat3 working2 working3 faminc2-faminc4 black hisother reg_midatlantic-reg_pacific, re


***********************************************************
*Tables A7 and A8 
gen ageln = ln(age)
gen agesq = age^2
table educyrs
gen educnew = 0 if educyrs<12
replace educnew = 1 if educyrs==12
replace educnew = 2 if educyrs>12 & educyrs<15
replace educnew = 3 if educyrs>15
table educnew education
set more off 
xtreg  pr_fare sp2_welf time unemp gdp gini100 female age educat2 educat3 working2 working3 faminc2-faminc4 black hisother reg_midatlantic-reg_pacific, re
estimates store base
xtreg  pr_fare sp2_welf time unemp gdp gini100 female ageln educat2 educat3 working2 working3 faminc2-faminc4 black hisother reg_midatlantic-reg_pacific, re
estimates store ageln
xtreg  pr_fare sp2_welf time unemp gdp gini100 female agesq educat2 educat3 working2 working3 faminc2-faminc4 black hisother reg_midatlantic-reg_pacific, re
estimates store agesq
esttab base ageln agesq , se
xtreg  pr_fare sp2_welf time unemp gdp gini100 female c.age i.educnew working2 working3 faminc2-faminc4 black hisother reg_midatlantic-reg_pacific, re
estimates store educcat
xtreg  pr_fare sp2_welf time unemp gdp gini100 female c.age  working2 working3 faminc2-faminc4 i.black##i.educnew i.hisother##i.educnew reg_midatlantic-reg_pacific, re
estimates store educcat_int
esttab base educcat educcat_int , se
	

***********************************************************
*Table A9
set more off 
xtreg  pr_fare sp2_welf unemp gdp_trend gdp_detrend gini100 female age educat2 educat3 working2 working3 faminc2-faminc4 black hisother reg_midatlantic-reg_pacific, re
estimates store prwelf9a
test gdp_trend = gdp_detrend
xtreg  pr_fare sp2_welf_detrend time unemp_detrend gdp_detrend gini100_detrend female age educat2 educat3 working2 working3 faminc2-faminc4 black hisother reg_midatlantic-reg_pacific, re
estimates store prwelf9b
esttab prwelf9a prwelf9b, se

	
***********************************************************
*Table 2
estimates clear
set more off
quietly xtreg pr_fare sp2_welf gini100 unemp gdp female educat2 educat3 working2 working3 faminc2-faminc4 black hisother reg_midatlantic-reg_pacific, re
* model 1: demographics & regions
xtreg pr_fare female educat2 educat3 working2 working3 faminc2-faminc4 black hisother reg_midatlantic-reg_pacific if e(sample), re
* model 2: + unemployment & gdp
xtreg pr_fare unemp gdp female educat2 educat3 working2 working3 faminc2-faminc4 black hisother reg_midatlantic-reg_pacific if e(sample), re
* model 3: + gini
xtreg pr_fare gini100 unemp gdp female educat2 educat3 working2 working3 faminc2-faminc4 black hisother reg_midatlantic-reg_pacific if e(sample), re
* model 4: + spending
xtreg pr_fare sp2_welf gini100 unemp gdp female educat2 educat3 working2 working3 faminc2-faminc4 black hisother reg_midatlantic-reg_pacific  if e(sample), re
* model 5: + spending w/o macroeconomics
xtreg pr_fare sp2_welf female educat2 educat3 working2 working3 faminc2-faminc4 black hisother reg_midatlantic-reg_pacific if e(sample), re


***********************************************************
*Figure A1
set more off
tablemat black hisother , stat(mean) by(year)
matrix A=M'
svmat A, names(sum_race)
tablemat year, stat(mean) by(year)
matrix A=M'
svmat A, names(sum_year)
replace sum_year=. if _n==1
graph twoway line sum_race1 sum_race2 sum_year if sum_year>1972, scheme(s1mono) lwidth(thick thick) lcolor(black black) lstyle(p1 p2)  ///
	xtitle("") ytitle("Proportion of Respondents") ylab(, angle(0)) ///
	xlab(1980 1990 2000 2010) xscale(range(1973 2012)) ///
	legend(off) text(.125 1977 "Black") text(.025 1977 "Hispanic/Other") ///
	note("Note: A Spanish version of the GSS was added in 2006.  A variable asking interviewers to record" "whether the respondent would have been excluded due to a language problem shows 236 such" "respondents in 2006, and 73 in 2008.") 
drop sum_*


***********************************************************
*Table A2
set more off
ologit  pr_fare sp2_welf time female age educat2 educat3 working2 working3 faminc2-faminc4 black hisother reg_midatlantic-reg_pacific, vce(cluster year) 
estimates store prwelf2a
ologit  pr_fare sp2_welf time unemp gdp  female age educat2 educat3 working2 working3 faminc2-faminc4 black hisother reg_midatlantic-reg_pacific, vce(cluster year) 
estimates store prwelf2b
ologit  pr_fare sp2_welf time unemp gdp gini100 female age educat2 educat3 working2 working3 faminc2-faminc4 black hisother reg_midatlantic-reg_pacific, vce(cluster year) 
estimates store prwelf2c
esttab prwelf2a prwelf2b prwelf2c, se
	
	
***********************************************************
*Table A3
gen partyID3=partyID
recode partyID3 0=1 1=1 2=0 3=0 4=0 5=2 6=2 
gen partypres=0
replace partypres=1 if year==2009
replace partypres=1 if year==2010
replace partypres=1 if year==2011
replace partypres=1 if year==2012
replace partypres=1 if year==1993
replace partypres=1 if year==1994
replace partypres=1 if year==1995
replace partypres=1 if year==1996
replace partypres=1 if year==1997
replace partypres=1 if year==1998
replace partypres=1 if year==1999
replace partypres=1 if year==2000
replace partypres=1 if year==1977
replace partypres=1 if year==1978
replace partypres=1 if year==1979
replace partypres=1 if year==1980
tab year partypres
label define partypres 0 "Rep" 1 "Dem"
label values partypres partypres
xtreg  pr_fare sp2_welf time unemp gdp gini100 female age educat2 educat3 working2 working3 faminc2-faminc4 black hisother reg_midatlantic-reg_pacific partypres, re
estimates store prwelfA2
xtreg  pr_fare sp2_welf time unemp gdp gini100 female age educat2 educat3 working2 working3 faminc2-faminc4 black hisother reg_midatlantic-reg_pacific i.partyID3, re
estimates store prwelfA3
esttab prwelfA2 prwelfA3, se


***********************************************************
*Table A4
gen social1 = sp2_welf + sp2_hea + sp2_edu
gen social2 = sp2_welf + sp2_hea + sp2_edu + sp2_env + sp2_cit
xtreg  pr_fare sp2_welf social1 time unemp gdp gini100 female age educat2 educat3 working2 working3 faminc2-faminc4 black hisother reg_midatlantic-reg_pacific, re
estimates store prwelfA5a
xtreg  pr_fare sp2_welf social2 time unemp gdp gini100 female age educat2 educat3 working2 working3 faminc2-faminc4 black hisother reg_midatlantic-reg_pacific, re
estimates store prwelfA5ab
esttab prwelfA5a prwelfA5ab, se
	

***********************************************************
*Table A5 
set more off 
xtreg  pr_farey sp2_welf time female age educat2 educat3 working2 working3 faminc2-faminc4 black hisother reg_midatlantic-reg_pacific, re
estimates store prwelf1a
xtreg  pr_farey sp2_welf time unemp gdp female age educat2 educat3 working2 working3 faminc2-faminc4 black hisother reg_midatlantic-reg_pacific, re
estimates store prwelf1b
xtreg  pr_farey sp2_welf time unemp gdp gini100 female age educat2 educat3 working2 working3 faminc2-faminc4 black hisother reg_midatlantic-reg_pacific, re
estimates store prwelf1c
esttab prwelf1a prwelf1b prwelf1c, se
	
	
***********************************************************
*Table A6
gen lnsp2_welf = ln(sp2_welf)
set more off 
xtreg  pr_fare lnsp2_welf time female age educat2 educat3 working2 working3 faminc2-faminc4 black hisother reg_midatlantic-reg_pacific, re
estimates store prwelf1a
xtreg  pr_fare lnsp2_welf time unemp gdp female age educat2 educat3 working2 working3 faminc2-faminc4 black hisother reg_midatlantic-reg_pacific, re
estimates store prwelf1b
xtreg  pr_fare lnsp2_welf time unemp gdp gini100 female age educat2 educat3 working2 working3 faminc2-faminc4 black hisother reg_midatlantic-reg_pacific, re
estimates store prwelf1c
xtreg  pr_fare lnsp2_welf sp2_welf time unemp gdp gini100 female age educat2 educat3 working2 working3 faminc2-faminc4 black hisother reg_midatlantic-reg_pacific, re
estimates store prwelf1d
test sp2_welf lnsp2_welf
esttab prwelf1a prwelf1b prwelf1c prwelf1d, se
 

***********************************************************
*Figures 2 and 3
reg pr_fare sp2_welf unemp gdp gini100 female educat2 educat3 working2 working3 faminc2-faminc4 black hisother reg_midatlantic-reg_pacific, vce(cluster year) 
matrix A=r(table)'
svmat A, names(regr_)
predict pred_1 if e(sample), xb
predict pred_1b if e(sample), res
tablemat  sp2_welf unemp gdp gini100 female educat2 educat3 working2 working3 faminc2-faminc4 black hisother reg_midatlantic-reg_pacific if e(sample), stat(mean)
matrix B=M
svmat B, names(mean_)
mkmat regr_* mean_1 if regr_1~=., matrix(C)
*FULL MODEL
gen pred_2 = ///
	C[1,1] * sp2_welf + ///
	C[2,1] * unemp + ///
	C[3,1] * gdp + ///	
	C[4,1] * gini100 + ///	
	C[5,1] * female + /// 
	C[6,1] * educat2 + /// 
	C[7,1] * educat3 + /// 
	C[8,1] * working2 + /// 
	C[9,1]* working3 + /// 
	C[10,1]* faminc2 + /// 
	C[11,1]* faminc3 + /// 
	C[12,1]* faminc4 + /// 
	C[13,1]* black + /// 
	C[14,1]* hisother + /// 
	C[15,1]* reg_midatlantic + /// 
	C[16,1]* reg_ENcentral + /// 
	C[17,1]* reg_WNcentral + /// 
	C[18,1]* reg_Satlantic + /// 
	C[19,1]* reg_EScentral + /// 
	C[20,1]* reg_WEcentral + /// 
	C[21,1]* reg_mountain + /// 
	C[22,1]* reg_pacific + /// 
	C[23,1] if e(sample)
*REGIONAL INTERCEPTS ONLY
gen pred_3 = ///
	C[1,1] * C[1,10] + ///
	C[2,1] * C[2,10] + ///
	C[3,1] * C[3,10] + ///	
	C[4,1] * C[4,10] + ///	
	C[5,1] * C[5,10] + /// 
	C[6,1] * C[6,10] + /// 
	C[7,1] * C[7,10] + /// 
	C[8,1] * C[8,10] + /// 
	C[9,1] * C[9,10] + /// 
	C[10,1]* C[10,10] + /// 
	C[11,1]* C[11,10] + /// 
	C[12,1]* C[12,10] + /// 
	C[13,1]* C[13,10] + /// 
	C[14,1]* C[14,10] + /// 
	C[15,1]* reg_midatlantic + /// 
	C[16,1]* reg_ENcentral + /// 
	C[17,1]* reg_WNcentral + /// 
	C[18,1]* reg_Satlantic + /// 
	C[19,1]* reg_EScentral + /// 
	C[20,1]* reg_WEcentral + /// 
	C[21,1]* reg_mountain + /// 
	C[22,1]* reg_pacific + /// 
	C[23,1] if e(sample)	
*PLUS DEMOGRAPHICS
gen pred_4 = ///
	C[1,1] * C[1,10] + ///
	C[2,1] * C[2,10] + ///
	C[3,1] * C[3,10] + ///	
	C[4,1] * C[4,10] + ///	
	C[5,1] * female + /// 
	C[6,1] * educat2 + /// 
	C[7,1] * educat3 + /// 
	C[8,1] * working2 + /// 
	C[9,1] * working3 + /// 
	C[10,1]* faminc2 + /// 
	C[11,1]* faminc3 + /// 
	C[12,1]* faminc4 + /// 
	C[13,1]* black + /// 
	C[14,1]* hisother + /// 
	C[15,1]* reg_midatlantic + /// 
	C[16,1]* reg_ENcentral + /// 
	C[17,1]* reg_WNcentral + /// 
	C[18,1]* reg_Satlantic + /// 
	C[19,1]* reg_EScentral + /// 
	C[20,1]* reg_WEcentral + /// 
	C[21,1]* reg_mountain + /// 
	C[22,1]* reg_pacific + /// 
	C[23,1] if e(sample)
*PLUS MACROECONOMICS
gen pred_5 = ///
	C[1,1] * C[1,10] + ///
	C[2,1] * unemp + ///
	C[3,1] * gdp + ///	
	C[4,1] * C[4,10] + ///	
	C[5,1] * female + /// 
	C[6,1] * educat2 + /// 
	C[7,1] * educat3 + /// 
	C[8,1] * working2 + /// 
	C[9,1] * working3 + /// 
	C[10,1]* faminc2 + /// 
	C[11,1]* faminc3 + /// 
	C[12,1]* faminc4 + /// 
	C[13,1]* black + /// 
	C[14,1]* hisother + /// 
	C[15,1]* reg_midatlantic + /// 
	C[16,1]* reg_ENcentral + /// 
	C[17,1]* reg_WNcentral + /// 
	C[18,1]* reg_Satlantic + /// 
	C[19,1]* reg_EScentral + /// 
	C[20,1]* reg_WEcentral + /// 
	C[21,1]* reg_mountain + /// 
	C[22,1]* reg_pacific + /// 
	C[23,1] if e(sample)
*PLUS GINI
gen pred_6 = ///
	C[1,1] * C[1,10] + ///
	C[2,1] * unemp + ///
	C[3,1] * gdp + ///	
	C[4,1] * gini100 + ///	
	C[5,1] * female + /// 
	C[6,1] * educat2 + /// 
	C[7,1] * educat3 + /// 
	C[8,1] * working2 + /// 
	C[9,1] * working3 + /// 
	C[10,1]* faminc2 + /// 
	C[11,1]* faminc3 + /// 
	C[12,1]* faminc4 + /// 
	C[13,1]* black + /// 
	C[14,1]* hisother + /// 
	C[15,1]* reg_midatlantic + /// 
	C[16,1]* reg_ENcentral + /// 
	C[17,1]* reg_WNcentral + /// 
	C[18,1]* reg_Satlantic + /// 
	C[19,1]* reg_EScentral + /// 
	C[20,1]* reg_WEcentral + /// 
	C[21,1]* reg_mountain + /// 
	C[22,1]* reg_pacific + /// 
	C[23,1] if e(sample)	
*PLUS RESIDUAL NET SUPPORT
gen pred_7 = pred_1b + ///
	C[1,1] * C[1,10] + ///
	C[2,1] * unemp + ///
	C[3,1] * gdp + ///	
	C[4,1] * gini100 + ///	
	C[5,1] * female + /// 
	C[6,1] * educat2 + /// 
	C[7,1] * educat3 + /// 
	C[8,1] * working2 + /// 
	C[9,1] * working3 + /// 
	C[10,1]* faminc2 + /// 
	C[11,1]* faminc3 + /// 
	C[12,1]* faminc4 + /// 
	C[13,1]* black + /// 
	C[14,1]* hisother + /// 
	C[15,1]* reg_midatlantic + /// 
	C[16,1]* reg_ENcentral + /// 
	C[17,1]* reg_WNcentral + /// 
	C[18,1]* reg_Satlantic + /// 
	C[19,1]* reg_EScentral + /// 
	C[20,1]* reg_WEcentral + /// 
	C[21,1]* reg_mountain + /// 
	C[22,1]* reg_pacific + /// 
	C[23,1] if e(sample)
pwcorr pred_1 pred_1b pred_2 pred_3 pred_4 pred_5 pred_6 pred_7
scalar SpCoef=C[1,1]
*CONVERTING PREFERENCES TO DOLLAR AMOUNTS
su regr_1 if _n==1
display ((1/r(mean))*-1)
gen pred_8=pred_7*((1/r(mean))*-1)	
*ADDITIONAL VARIABLES BEFORE GENERATING YEARLY DATA
tab pr_fare, gen(prefs)
rename prefs1 pr_fare_less
rename prefs2 pr_fare_same
rename prefs3 pr_fare_more
*YEARLY DATA
set more off	
tablemat pred_1 pred_2 pred_3 pred_4 pred_5 pred_6 pred_7 pred_1b unemp gdp gini100 pr_fare pr_fare_more pr_fare_same pr_fare_less sp2_welf year female educat2 educat3 working2 working3 faminc2-faminc4 black hisother reg_midatlantic-reg_pacific , stat(mean) by(year)
matrix R=M'
svmat R, names(sum_)
foreach var of varlist sum_1-sum_35 {
	replace `var'=. if _n==1
	}
rename sum_1 sum_pred1
rename sum_2 sum_pred2
rename sum_3 sum_pred3
rename sum_4 sum_pred4
rename sum_5 sum_pred5
rename sum_6 sum_pred6
rename sum_7 sum_pred7
rename sum_8 sum_pred1b
rename sum_9 sum_unemp
rename sum_10 sum_gdp
rename sum_11 sum_gini100
rename sum_12 sum_pr_fare
rename sum_13 sum_pr_fare_more
rename sum_14 sum_pr_fare_same
rename sum_15 sum_pr_fare_less
rename sum_16 sum_sp2_welf
rename sum_17 sum_year
rename sum_18 sum_female
rename sum_19 sum_educat2
rename sum_20 sum_educat3
rename sum_21 sum_working2
rename sum_22 sum_working3
rename sum_23 sum_faminc2
rename sum_24 sum_faminc3
rename sum_25 sum_faminc4
rename sum_26 sum_black
rename sum_27 sum_hisother
rename sum_28 sum_reg_midatlantic
rename sum_29 sum_reg_ENcentral
rename sum_30 sum_reg_WNcentral
rename sum_31 sum_reg_Satlantic
rename sum_32 sum_reg_EScentral
rename sum_33 sum_reg_WEcentral
rename sum_34 sum_reg_mountain
rename sum_35 sum_reg_pacific
gen sum_netsupport=(sum_pr_fare_more*100)-(sum_pr_fare_less*100)
label variable sum_pred1 "predictions, from regression"
label variable sum_pred1b "residuals, from regression"
label variable sum_pred2 "predictions, from coefficients"
label variable sum_pred3 "predictions, from coefficients, just get ahead and regional dummies"
label variable sum_pred4 "predictions, from coefficients, plus demographics"
label variable sum_pred5 "predictions, from coefficients, plus macroeconomics"
label variable sum_pred6 "predictions, from coefficients, plus residual net support"
label variable sum_netsupport "Net support, WELFARE"
label variable sum_unemp "Unemployment"
label variable sum_gdp "GDP"
label variable sum_gini100 "Gini 100"
label variable sum_pr_fare "Welfare preferences, mean"
label variable sum_pr_fare_more "Welfare preferences, more"
label variable sum_pr_fare_same "Welfare preferences, same"
label variable sum_pr_fare_less "Welfare preferences, less"
label variable sum_sp2_welf "Welfare spending"
label variable sum_year "Year"
*MOVING TO AGGREGATE DATASET
keep sum_*
order sum_year, first
drop if sum_year==.
gen time=_n
order time, first
rename sum_year year
tsset year
*MODELS
reg sum_pr_fare sum_sp2_welf sum_gdp sum_unemp sum_gini100 time
pwcorr sum_gdp sum_unemp sum_gini100 time
pwcorr sum_pred6 sum_pred7
pwcorr sum_pred6 sum_pr_fare
gen R=.
gen Pstar=.
gen P=.
replace R=sum_pr_fare
replace P=sum_sp2_welf
replace Pstar=sum_pred6
reg R P Pstar
estimates store A
*CALIBRATING P*, using "Welfare" preferences
replace R=sum_pr_fare
replace Pstar=sum_pred6
replace P=sum_sp2_welf
/* We begin with a simple time series model of Rt regressed on both spending (Pt) 
and the estimated (P_t^* )? series */
reg R P Pstar
matrix R=e(b)'
predict R_hat if e(sample)
/* The coefficient for spending (?1) indicates the shift in R that follows from the 
one-unit increase in spending (P) */
scalar B_1=R[1,1]
display B_1
scalar B_2=R[2,1]
display B_2
scalar a_1=R[3,1]
display a_1
/* -1/?1  is thus the amount of spending required to produce a one-unit shift in R 
(recalling that ?1 has a negative sign) */
scalar R_cash=-1/R[1,1]
display R_cash
/* Now, this is a mean effect, which presumably varies over the time period of our 
analysis owing to the level of spending (and GDP).  To take this into account in 
our simulation, we divide -1/?1 by the mean of spending ("P"  ?) to produce a 
standardized measure, i.e., the proportional shift in spending that would produce 
a unit shift in R. */
su P if e(sample)
scalar P_bar=r(mean)
scalar R_prop=(R_cash)/P_bar
display R_prop
/* In each year, then, the estimated level of spending that would be required for 
predicted values of Rt to be equal to 2 is as follows */
gen Pstar1a=P + ((2-R_hat)/B_1)
label variable Pstar1a "P$*, using Welfare preferences v1"
*RE-CALIBRATING, BUT USING A DIFFERENT EQUILIBRIUM
gen Pstar2a=P + ((1.73-R_hat)/B_1)
label variable Pstar2a "P$*, using Welfare preferences v1"
*diagnostics
su Pstar1a Pstar2a  sum_sp2_welf if Pstar1a~=.
gen prop1=Pstar1a/sum_sp2_welf
gen prop2=Pstar2a/sum_sp2_welf
gen prop3=Pstar2a/Pstar1a
su prop1 prop2 prop3 if Pstar1a~=.
pwcorr Pstar1a Pstar2a P
su Pstar1a
su P
display 2.69/6.43
su Pstar2a
su R

*Figure 2
graph twoway line sum_pred4 sum_pred5 sum_pred6 sum_pred7 year if year>1972, scheme(s1mono) ///
	lwidth(medthick medthick thick medthick) lcolor( gray gray black black) lstyle( p2 p1 p1 p2) ///
	xtitle("") ytitle("Estimated Absolute Preferences (1-3)") ylab(1.2 1.6 2 2.4, angle(0) labsize(small)) ///
	xlab(1980 1990 2000 2010) xscale(range(1973 2016))  ///
	yline(0, lstyle(p3) lcolor(gray) lwidth(thin)) ///
	legend(lab(1 " Regions + Demographics") ///
	lab(2 "   + Unemployment & GDP") lab(3 "    + Gini") ///
	lab(4 "     + Residual Net Support") ///
	position(11) ring(0) col(1) keygap(.8) symxsize(6) symysize(.8) rowgap(1) size(small) region(lstyle(none)) ) ///
	note("Note: Based on an OLS model of Net Support including all variables except trend." "In all cases, excluded variables are held at their mean values.", size(vsmall))

*Figure 3
pwcorr sum_pred6 sum_pr_fare if year>1972, sig obs
graph twoway (line sum_pred6 sum_pr_fare year if year>1972, scheme(s1mono) ///
	lwidth(thick) lcolor(black black) lstyle(p1 p2) ///
	xtitle("") ytitle("Estimated Absolute/Relative Preferences (1-3)", color(black)) ylab(1.2 1.6 2 2.4, angle(0) labsize(small)) ///
	xlab(1980 1990 2000 2010) xscale(range(1973 2016))  ///
	yline(0, lstyle(p3) lcolor(gray) lwidth(thin)) ///
	legend(lab(1 "Estimated Absolute Preferences (P*)") lab(2 "Relative Preferences (R)") ///
	position(11) ring(0) col(1) keygap(.8) symxsize(6) symysize(.8) rowgap(1) size(small) region(lstyle(none)) ) ///
	note("Note: P* is based on an OLS model of Net Support including all variables except trend. In all cases, excluded variables are held" "at their mean values. R is based on survey marginals.", size(vsmall)) ///
	text(2.37 2016 "Pearson's r=.62 (p<.01)", size(small) placement(w) color(gray)) )

*Figure 4
graph twoway line Pstar1a Pstar2a P year if year>1972, scheme(s1mono) ///
	lwidth(thick thick medthick) lcolor(black black gray) ///
	lstyle(p1 p3 p2)  yscale(range(0 12)) ///
	xtitle("") ytitle("Welfare Spending (hundreds, 2009USD)") ylab(0 2 4 6 8 10 , angle(0)) ///
	xlab(1980 1990 2000 2010) xscale(range(1973 2016))  ///
	legend(lab(1 "Estimated P$*, mid-point=2") lab(2 "Estimated P$*, mid-point=1.73") lab(3 "Actual Spending") ///
	position(11) ring(0) col(1) keygap(.8) symxsize(6) symysize(.8) rowgap(1) size(small) region(lstyle(none)) ) ///
	note(" ", size(vsmall))


